package vin.pth.authorization.provider;

import java.util.Map;
import vin.pth.authorization.exception.AuthorizationException;
import vin.pth.base.pojo.Authentication;

/**
 * 认证Provider.
 *
 * @author cocoon
 */
public interface AuthorizationProvider {

  /**
   * 认证.
   *
   * @param param 认证参数
   * @return 认证结果
   * @throws AuthorizationException 鉴权异常
   */
  Authentication authenticate(Map<String, Object> param) throws AuthorizationException;

  /**
   * 是否支持该认证对象.
   *
   * @param param 认证对象.
   * @return 认证结果
   */
  boolean supports(Map<String, Object> param);

}